<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> 
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE html>
<html>
<head>
<base href="<%=basePath%>">
<title>于都县残疾人信息管理系统</title>
<link href="<%=basePath%>/assets/css/dpl-min.css" rel="stylesheet"
	type="text/css" />
<link href="<%=basePath%>/assets/css/bui-min.css" rel="stylesheet"
	type="text/css" />
<link href="<%=basePath%>/assets/css/main.css" rel="stylesheet"
	type="text/css" />
<style type="text/css">
.span8 label.control-label {
	width: 150px;
	display: inline-block;
}

table.table1 td.right-td {
	text-align: right;
	background-color: #EAEAEA;
}
.table1{
	border:1px solid #cad9ea; 
	color:#666; 
}
.table1 td,.table1 th{ 
border:1px solid #cad9ea; 
padding:5px 1em 5px; 
min-width:30px;
} 
</style>
</head>
<body style="margin: 0 auto;width: 1600px;">
	<div class="main-con" id="maincon">
	<!-- 	<div class="flow-steps">
			<ol class="num4">
				<li class="first"><i class="icon-ok"></i>1.建档立卡</li>
				<li class="current-prev">2.完善家庭情況信息</li>
				<li class="current">3.项目情况信息</li>
				<li class="last">4.完成</li>
			</ol>
		</div> -->
		<div class="detail-page">
			<h2>于都县纳入扶贫系统已办证残疾人信息登记表（以户为单位）</h2>
			<p class="auxiliary-text pull-right">填报时间：<fmt:formatDate value="${baseInfo.addTime }" pattern="yyyy年MM月dd日  HH:mm"/></p>
			<div class="detail-section">
				<h3>一、残疾人扶贫户建档立卡主要信息及家庭成员基本情况</h3>
				<div>
					<div class="row">
						<table class="table1" style="width: 100%;">
							<tbody>
								<tr>
									<td class="right-td">户主姓名</td>
									<td>${baseInfo.huzhuName }</td>
									<td class="right-td">家庭人口</td>
									<td>${baseInfo.totalNum }</td>
									<td class="right-td">残疾人口</td>
									<td>${baseInfo.disaNum }</td>
									<td class="right-td">贫困属性</td>
									<td>${baseInfo.poorShuxing }</td>
									<td class="right-td">主要致贫原因</td>
									<td>${baseInfo.poorCause }</td>
									<td class="right-td">主要收入来源</td>
									<td>${baseInfo.mainIncome }</td>
									<td class="right-td">上年度人均纯收入 </td>
									<td>${baseInfo.lastPerIncome }（元）</td>
									
									<td class="right-td">是否脱贫</td>
									<td><c:if test="${baseInfo.isOutPoor ==1}">是</c:if> <c:if
											test="${baseInfo.isOutPoor ==0}">否</c:if></td>
									<td class="right-td">脱贫时间</td>
									<td>${baseInfo.outPoorDate }</td>
									<td class="right-td">脱贫方式</td>
									<td>${baseInfo.outPoorWay }</td>
								</tr>
								<tr>
									<td class="right-td">家庭地址</td>
									<td colspan="11">于都县&nbsp;${baseInfo.town }&nbsp;${baseInfo.vallige }&nbsp;${baseInfo.team }</td>
									<td class="right-td">联系电话</td>
									<td colspan="7">${baseInfo.contact }</td>
								</tr>
							</tbody>
						</table>
					</div>
				</div>
			</div>
			<div style="clear: both;"></div>
			<div class="detail-section">
				<div class="row detail-row">
					<div id="grid"></div>
				</div>
			</div>
			<div class="detail-section">
				<h3>二、残疾人享受帮扶项目或资金情况</h3>
				<div class="row detail-row">
					<div id="grid2">
						<table class="table1" style="width: 100%;">
							<tr>
								<th>项目</th>
								<th colspan="2">1.产业扶贫</th>
								<th colspan="2">2.安居扶贫</th>
								<th colspan="2">3.健康扶贫</th>
								<th colspan="2">4.就业扶贫</th>
								<th colspan="2">5.教育扶贫</th>
								<th colspan="2">6.兜底保障扶贫</th>
								<th colspan="2">7.社会扶贫</th>
								<th colspan="3">8.金融扶贫</th>
								<th colspan="2">9.其他扶贫</th>
								<th rowspan="2">操作</th>
							</tr>
							<tr>
								<th>享受年度</th>
								<th>享受项目</th>
								<th>奖补金额</th>
								<th>享受项目</th>
								<th>享受金额</th>
								<th>享受项目</th>
								<th>享受金额</th>
								<th>享受项目</th>
								<th>享受金额</th>
								<th>享受项目</th>
								<th>享受金额</th>
								<th>享受项目</th>
								<th>享受金额</th>
								<th>获赠项目</th>
								<th>金额</th>
								<th>享受项目</th>
								<th>贷款金额</th>
								<th>享受贴息金额</th>
								<th>受益项目</th>
								<th>受益金额</th>
							</tr>
							<tr>
								<td>2015年</td>
								<td>${project2015.chanyeItem1 }</td>
								<td>${project2015.chanyeItem2 }</td>
								<td>${project2015.anjuItem1 }</td>
								<td>${project2015.anjuItem2 }</td>
								<td>${project2015.jiankangItem1 }</td>
								<td>${project2015.jiankangItem2 }</td>
								<td>${project2015.jiuyeItem1 }</td>
								<td>${project2015.jiuyeItem2 }</td>
								<td>${project2015.jiaoyuItem1 }</td>
								<td>${project2015.jiaoyuItem2 }</td>
								<td>${project2015.doudiItem1 }</td>
								<td>${project2015.doudiItem2 }</td>
								<td>${project2015.shehuiItem1 }</td>
								<td>${project2015.shehuiItem2 }</td>
								<td>${project2015.jinrongItem1 }</td>
								<td>${project2015.jinrongItem2 }</td>
								<td>${project2015.jinrongItem3 }</td>
								<td>${project2015.qitaItem1 }</td>
								<td>${project2015.qitaItem2 }</td>
								<td>
									<a href="javascript:void(0)"  class="addPro"  
										data-niandu="2015" data-pro="chanyeItem1:${project2015.chanyeItem1 }-chanyeItem2:${project2015.chanyeItem2 }-anjuItem1:${project2015.anjuItem1 }-anjuItem2:${project2015.anjuItem2 }-jiankangItem1:${project2015.jiankangItem1 }-jiankangItem2:${project2015.jiankangItem2 }-jiuyeItem1:${project2015.jiuyeItem1 }- jiuyeItem2:${project2015.jiuyeItem2 }- jiaoyuItem1:${project2015.jiaoyuItem1 }-jiaoyuItem2:${project2015.jiaoyuItem2 }-doudiItem1:${project2015.doudiItem1 }- doudiItem2:${project2015.doudiItem2 }- shehuiItem1:${project2015.shehuiItem1 }-shehuiItem2:${project2015.shehuiItem2 }-jinrongItem1:${project2015.jinrongItem1 }-jinrongItem2:${project2015.jinrongItem2 }-jinrongItem3:${project2015.jinrongItem3 }-qitaItem1:${project2015.qitaItem1 }-qitaItem2:${project2015.qitaItem2 }">填报数据</a>
								</td>                   
							</tr>
							<tr>
								<td>2016年</td>
								<td>${project2016.chanyeItem1 }</td>
								<td>${project2016.chanyeItem2 }</td>
								<td>${project2016.anjuItem1 }</td>
								<td>${project2016.anjuItem2 }</td>
								<td>${project2016.jiankangItem1 }</td>
								<td>${project2016.jiankangItem2 }</td>
								<td>${project2016.jiuyeItem1 }</td>
								<td>${project2016.jiuyeItem2 }</td>
								<td>${project2016.jiaoyuItem1 }</td>
								<td>${project2016.jiaoyuItem2 }</td>
								<td>${project2016.doudiItem1 }</td>
								<td>${project2016.doudiItem2 }</td>
								<td>${project2016.shehuiItem1 }</td>
								<td>${project2016.shehuiItem2 }</td>
								<td>${project2016.jinrongItem1 }</td>
								<td>${project2016.jinrongItem2 }</td>
								<td>${project2016.jinrongItem3 }</td>
								<td>${project2016.qitaItem1 }</td>
								<td>${project2016.qitaItem2 }</td>
								<td>
									<a href="javascript:void(0)"  class="addPro"  
										data-niandu="2016" data-pro="chanyeItem1:${project2016.chanyeItem1 }-chanyeItem2:${project2016.chanyeItem2 }-anjuItem1:${project2016.anjuItem1 }-anjuItem2:${project2016.anjuItem2 }-jiankangItem1:${project2016.jiankangItem1 }-jiankangItem2:${project2016.jiankangItem2 }-jiuyeItem1:${project2016.jiuyeItem1 }- jiuyeItem2:${project2016.jiuyeItem2 }- jiaoyuItem1:${project2016.jiaoyuItem1 }-jiaoyuItem2:${project2016.jiaoyuItem2 }-doudiItem1:${project2016.doudiItem1 }- doudiItem2:${project2016.doudiItem2 }- shehuiItem1:${project2016.shehuiItem1 }-shehuiItem2:${project2016.shehuiItem2 }-jinrongItem1:${project2016.jinrongItem1 }-jinrongItem2:${project2016.jinrongItem2 }-jinrongItem3:${project2016.jinrongItem3 }-qitaItem1:${project2016.qitaItem1 }-qitaItem2:${project2016.qitaItem2 }">填报数据</a>
								</td>                   
							</tr>
							<tr>
								<td>2017年</td>
								<td>${project2017.chanyeItem1 }</td>
								<td>${project2017.chanyeItem2 }</td>
								<td>${project2017.anjuItem1 }</td>
								<td>${project2017.anjuItem2 }</td>
								<td>${project2017.jiankangItem1 }</td>
								<td>${project2017.jiankangItem2 }</td>
								<td>${project2017.jiuyeItem1 }</td>
								<td>${project2017.jiuyeItem2 }</td>
								<td>${project2017.jiaoyuItem1 }</td>
								<td>${project2017.jiaoyuItem2 }</td>
								<td>${project2017.doudiItem1 }</td>
								<td>${project2017.doudiItem2 }</td>
								<td>${project2017.shehuiItem1 }</td>
								<td>${project2017.shehuiItem2 }</td>
								<td>${project2017.jinrongItem1 }</td>
								<td>${project2017.jinrongItem2 }</td>
								<td>${project2017.jinrongItem3 }</td>
								<td>${project2017.qitaItem1 }</td>
								<td>${project2017.qitaItem2 }</td>
								<td>
									<a href="javascript:void(0)"  class="addPro"  
										data-niandu="2017" data-pro="chanyeItem1:${project2017.chanyeItem1 }-chanyeItem2:${project2017.chanyeItem2 }-anjuItem1:${project2017.anjuItem1 }-anjuItem2:${project2017.anjuItem2 }-jiankangItem1:${project2017.jiankangItem1 }-jiankangItem2:${project2017.jiankangItem2 }-jiuyeItem1:${project2017.jiuyeItem1 }- jiuyeItem2:${project2017.jiuyeItem2 }- jiaoyuItem1:${project2017.jiaoyuItem1 }-jiaoyuItem2:${project2017.jiaoyuItem2 }-doudiItem1:${project2017.doudiItem1 }- doudiItem2:${project2017.doudiItem2 }- shehuiItem1:${project2017.shehuiItem1 }-shehuiItem2:${project2017.shehuiItem2 }-jinrongItem1:${project2017.jinrongItem1 }-jinrongItem2:${project2017.jinrongItem2 }-jinrongItem3:${project2017.jinrongItem3 }-qitaItem1:${project2017.qitaItem1 }-qitaItem2:${project2017.qitaItem2 }">填报数据</a>
								</td>
							</tr>
							<tr>
								<td>2018年</td>
								<td>${project2018.chanyeItem1 }</td>
								<td>${project2018.chanyeItem2 }</td>
								<td>${project2018.anjuItem1 }</td>
								<td>${project2018.anjuItem2 }</td>
								<td>${project2018.jiankangItem1 }</td>
								<td>${project2018.jiankangItem2 }</td>
								<td>${project2018.jiuyeItem1 }</td>
								<td>${project2018.jiuyeItem2 }</td>
								<td>${project2018.jiaoyuItem1 }</td>
								<td>${project2018.jiaoyuItem2 }</td>
								<td>${project2018.doudiItem1 }</td>
								<td>${project2018.doudiItem2 }</td>
								<td>${project2018.shehuiItem1 }</td>
								<td>${project2018.shehuiItem2 }</td>
								<td>${project2018.jinrongItem1 }</td>
								<td>${project2018.jinrongItem2 }</td>
								<td>${project2018.jinrongItem3 }</td>
								<td>${project2018.qitaItem1 }</td>
								<td>${project2018.qitaItem2 }</td>
								<td>
									<a href="javascript:void(0)"  class="addPro"  
										data-niandu="2018" data-pro="chanyeItem1:${project2018.chanyeItem1 }-chanyeItem2:${project2018.chanyeItem2 }-anjuItem1:${project2018.anjuItem1 }-anjuItem2:${project2018.anjuItem2 }-jiankangItem1:${project2018.jiankangItem1 }-jiankangItem2:${project2018.jiankangItem2 }-jiuyeItem1:${project2018.jiuyeItem1 }- jiuyeItem2:${project2018.jiuyeItem2 }- jiaoyuItem1:${project2018.jiaoyuItem1 }-jiaoyuItem2:${project2018.jiaoyuItem2 }-doudiItem1:${project2018.doudiItem1 }- doudiItem2:${project2018.doudiItem2 }- shehuiItem1:${project2018.shehuiItem1 }-shehuiItem2:${project2018.shehuiItem2 }-jinrongItem1:${project2018.jinrongItem1 }-jinrongItem2:${project2018.jinrongItem2 }-jinrongItem3:${project2018.jinrongItem3 }-qitaItem1:${project2018.qitaItem1 }-qitaItem2:${project2018.qitaItem2 }">填报数据</a>
								</td>
							</tr>                                              
						</table>
					</div>
				</div>
			</div>

		</div>
		<div class="demo-content">
		<!-- 初始隐藏 dialog内容 -->
		<div id="content" class="hide">
			<form class="form-horizontal"  method="post">
				<div class="row">
					<div class="control-group span8">
						<label class="control-label"><s>*</s>姓名：</label>
						<div class="controls">
							<input name="username" type="text" 
								class="input-normal control-text">
						</div>
					</div>
					<div class="control-group span8">
						<label class="control-label"><s>*</s>性别：</label>
						<div class="controls">
							<p>
								<label><input id="gender1" name="gender" type="radio" value="男">男</label>
								<label><input id="gender2" name="gender" type="radio" value="女">女</label>
							</p>
						</div>
					</div>
					
				</div>
				<div class="row">
					<div class="control-group span8">
						<label class="control-label"><s>*</s>二代身份证号码：</label>
						<div class="controls">
							<input name="identityCard" type="text"
								data-rules="{required:true}"
								class="input-normal control-text">
							<input name="memberId" type="hidden" 
								class="input-normal control-text">
							<input name="baseInfoId" type="hidden" 
								class="input-normal control-text">
						</div>
					</div>
					<div class="control-group span8">
						<label class="control-label">是否户主：</label>
						<div class="controls">
							<p>
								<label><input id="isHuzhu1" name="isHuzhu" type="radio" value="0">否</label>
								<label><input id="isHuzhu2" name="isHuzhu" type="radio" value="1">是</label>
							</p>
						</div>
					</div>
				</div>
				<div class="row">
					<div class="control-group span8">
						<label class="control-label"><s>*</s>文化程度：</label>
						<div class="controls">
							<input name="education" type="text" 
								class="input-normal control-text">
						</div>
					</div>
					<div class="control-group span8">
						<label class="control-label"><s>*</s>从业情况：</label>
						<div class="controls">
							<input name="workstatus" type="text" 
								class="input-normal control-text">
						</div>
					</div>
				</div>
				
				<div class="row">
					<div class="control-group span8">
						<label class="control-label"><s>*</s>是否享受低保：</label>
						<div class="controls">
							<p>
								<label><input id="isInDibao1" name="isInDibao" type="radio" value="1">是</label>
								<label><input id="isInDibao2" name="isInDibao" type="radio" value="0">否</label>
							</p>
						</div>
					</div>
					<div class="control-group span8">
						<label class="control-label"><s>*</s>是否参加医疗保险：</label>
						<div class="controls">
							<p>
								<label><input id="isInYibao1" name="isInYibao" type="radio" value="1">是</label>
								<label><input id="isInYibao2" name="isInYibao" type="radio" value="0">否</label>
							</p>
						</div>
						
					</div>
				</div>
				<div class="row">
					<div class="control-group span8">
						<label class="control-label"><s>*</s>是否参加养老保险：</label>
						<div class="controls">
							<p>
								<label><input id="isInYanglao1" name="isInYanglao" type="radio" value="1">是</label>
								<label><input id="isInYanglao2" name="isInYanglao" type="radio" value="0">否</label>
							</p>
						</div>
					</div>
					<div class="control-group span8">
						<label class="control-label"><s>*</s>备注：</label>
						<div class="controls">
							<input name="memo" type="text" class="input-normal control-text">
						</div>
					</div>
				</div>
				
			 
				<div class="row">
					<div class="control-group span8">
						<label class="control-label">是否残疾：</label>
						<div class="controls">
							<p>
								<label><input id="isDisable1" name="isDisable" type="radio" value="0">否</label>
								<label><input id="isDisable2" name="isDisable" type="radio" value="1">是</label>
							</p>
						</div>
					</div>
				</div>
				
				<div style="display:none" data-depends="{'#isDisable2:checked':['show','enable'],'#isDisable2:unchecked':['hide','disable','clearErrors']}" class="bui-form-group">
					<div class="row">
						<div class="control-group span8">
							<label class="control-label"><s>*</s>第二代残疾证编号：</label>
							<div class="controls">
								<input name="disableCard" type="text" class="input-normal control-text">
							</div>
						</div>
						<div class="control-group span8">
							<label class="control-label"><s>*</s>多重说明：</label>
							<div class="controls">
								<input name="disaHow" type="text" class="input-normal control-text">
							</div>
						</div>
					</div>
					<div class="row">
						<div class="control-group span8">
							<label class="control-label"><s>*</s>残疾类别：</label>
							<div class="controls">
								<input name="disaType" type="text" class="input-normal control-text">
							</div> 
						</div>
						<div class="control-group span8">
							<label class="control-label"><s>*</s>残疾等级：</label>
							<div class="controls">
								<input name="disaLevel" type="text" class="input-normal control-text">
							</div>
						</div>
					</div>
					<div class="row">
						<div class="control-group span8">
							<label class="control-label"><s>*</s>婚姻状况：</label>
							<div class="controls">
								<input name="marryStatus" type="text" class="input-normal control-text">
							</div> 
						</div>
						<div class="control-group span8">
							<label class="control-label">有无劳动能力：</label>
							<div class="controls">
								<input name="hasWorkable" type="text" class="input-normal control-text">
							</div>
						</div>
					</div>
				</div>
			</form>
		</div><!-- #content end -->
		<!-- 项目信息维护弹窗 -->
		<div id="content2" class="hide">
	      <form id="form2" class="form-horizontal" >
	      <input type="hidden" name="baseId" value="${baseInfo.id}" />
	      	<span id="title-niandu"></span>年度<input type="hidden" name="niandu" value="2015" />
	         <table class="table1">
				<tr><th>项目</th><th>子项目</th><th>数据</th><th>项目</th><th>子项目</th><th>数据</th></tr>	         
				<tr><th rowspan="2">1.产业扶贫</th><td>享受项目</td><td><input type="text" name="chanyeItem1"/></td><th rowspan="2">6.兜底保障扶贫</th><td>享受项目</td><td><input type="text" name="doudiItem1"/></td></tr>	         
				<tr><td>奖补金额</td><td><input type="text" name="chanyeItem2"/></td><td>奖补金额</td><td><input type="text" name="doudiItem2"/></td></tr>	         
				<tr><th rowspan="2">2.安居扶贫</th><td>享受项目</td><td><input type="text" name="anjuItem1"/></td><th rowspan="2">7.社会扶贫</th><td>获赠项目</td><td><input type="text" name="shehuiItem1"/></td></tr>	         
				<tr><td>奖补金额</td><td><input type="text" name="anjuItem2"/></td><td>获赠金额</td><td><input type="text" name="shehuiItem2"/></td></tr>	         
				<tr><th rowspan="2">3.健康扶贫</th><td>享受项目</td><td><input type="text" name="jiankangItem1"/></td><th rowspan="3">8.金融扶贫</th><td>享受项目</td><td><input type="text" name="jinrongItem1"/></td></tr>	         
				<tr><td>享受金额</td><td><input type="text" name="jiankangItem2"/></td><td>贷款金额</td><td><input type="text" name="jinrongItem2"/></td></tr>	         
				<tr><th rowspan="2">4.就业扶贫</th><td>享受项目</td><td><input type="text" name="jiuyeItem1"/></td><td>享受贴息金额</td><td><input type="text" name="jinrongItem3"/></td></tr>	         
				<tr><td>享受金额</td><td><input type="text" name="jiuyeItem2"/></td><th rowspan="3">9.其他扶贫</th><td>受益项目</td><td><input type="text" name="qitaItem1"/></td></tr>	         
				<tr><th rowspan="2">5.教育扶贫</th><td>享受项目</td><td><input type="text" name="jiaoyuItem1"/></td><td>受益金额</td><td><input type="text" name="qitaItem2"/></td></tr>	         
				<tr><td>享受金额</td><td><input type="text" name="jiaoyuItem2"/></td><td></td><td></td></tr>	         
	         </table>
	      </form>
    	</div><!-- #content2 end -->
		
	</div>
		 
	</div>
	<script type="text/javascript" src="assets/js/jquery-1.8.1.min.js"></script>
	<script type="text/javascript" src="assets/js/bui-min.js"></script>
	<script type="text/javascript" src="assets/js/sea.js"></script>
	<script type="text/javascript" src="assets/js/config-min.js"></script>
	<script type="text/javascript">
	 BUI.use(['bui/overlay','bui/form'],function(Overlay,Form){
		    
	      var form = new Form.HForm({
	        srcNode : '#form2'
	      }).render();
	 
	      var dialog = new Overlay.Dialog({
	            title:'残疾人享受帮扶项目或资金情况',
	            width:780,
	            height:500,
	            //配置DOM容器的编号
	            contentId:'content2',
	            success:function () {
	            	$.ajax({
	                    cache: true,
	                    type: "POST",
	                    url:'data/addupdateproject',
	                    data:$('#form2').serialize(),// 你的formid
	                    async: false,
	                    error: function(request) {
	                    	console.log(request);
	                        alert("Connection error");
	                    },
	                    beforeSend:function(XMLHttpRequest){
	                    	//alert($("input[name=niandu]").val());
	    	            },
	                    success: function(data) {
	                        alert("成功提交！");
	                    	if(top.topManager){
	                    		top.topManager.reloadPage()
	                    	}
	                    }
	                    
	                });
	            	 
	              this.close();
	            }
	          });
	        //dialog.show();
	        $('.addPro').on('click',function () {
	        	var str = $(this).attr("data-pro");
	        	var niandu = $(this).attr("data-niandu");
	        	$("#title-niandu").html(niandu);
	        	$("input[name=niandu]").val(niandu);
	        	var strs= new Array(); //定义一数组 
	        	strs=str.split("-"); //字符分割 
        		var i = 1;
	        	$("#form2").find("input[type=text]").each(function(k,v){
	        		//console.log($(this).attr("name")+(i++));
	        		for (i=0;i<strs.length ;i++ ) { 
		        		var s = strs[i].split(":");
		        		if(s[0]==$(this).attr("name")){
		        			$(this).val(s[1]);
		        		}
		        	}
	        	});
	        	 
	          	dialog.show();
	        });
	     
	 });
		BUI.use([ 'bui/grid', 'bui/data', 'common/search' ],
						function(Grid, Data, Search) {
							var Grid = Grid, Store = Data.Store, enumgenderObj = {
								0 : "否",
								1 : "是"
							}, columns = [
									{
										title : '项目',
										dataIndex : 'item',
										elCls : 'center',
										width : 50,
										renderer:function(v,obj){
											console.log(9999);
											console.log(v);
											console.log(obj);
											var	rv = '<span class="x-icon x-icon-small x-icon-info" title="'+obj.item+'"><i class="icon icon-user icon-white"></i></span>';
											if(obj.isDisable==1){
												rv = '<span class="x-icon x-icon-small x-icon-info" title="'+obj.item+'"><i class="icon icon-user icon-white"></i></span>';
											}else{
												rv = '<span class="x-icon x-icon-small x-icon-success" title="'+obj.item+'"><i class="icon icon-user icon-white"></i></span>';
											} 
											if(obj.isHuzhu==1){
												rv = '<span class="x-icon x-icon-small x-icon-success" title="'+obj.item+'"><i class="icon icon-home icon-white"></i></span>';
											}
											//"除户主、残疾人外其他成员信息"
											return rv;
										}
									},
									{
										title : '姓名',
										dataIndex : 'username',
										elCls : 'center',
										width : 80
									},
									{
										title : '性别',
										dataIndex : 'gender',
										elCls : 'center',
										width : 50
									},{
										title : '文化程度',
										dataIndex : 'education',
										elCls : 'center',
										width : 50
									},{
										title : '二代身份证号码',
										dataIndex : 'identityCard',
										elCls : 'center',
										width : 100
									},
									{
										title : '从业情况',
										dataIndex : 'workstatus',
										elCls : 'center',
										width : 100
									},
									{
										title : '是否户主',
										dataIndex : 'isHuzhu',
										elCls : 'center',
										visible:false,
										width : 50,
										renderer : Grid.Format.multipleItemsRenderer(enumgenderObj)
									},
									{
										title : '是否享受低保',
										dataIndex : 'isInDibao',
										elCls : 'center',
										width : 50,
										renderer : Grid.Format.multipleItemsRenderer(enumgenderObj)
									},
									{
										title : '是否享受医保',
										dataIndex : 'isInYibao',
										elCls : 'center',
										width : 50,
										renderer : Grid.Format.multipleItemsRenderer(enumgenderObj)
									},
									{
										title : '是否参加养老保险',
										dataIndex : 'isInYanglao',
										elCls : 'center',
										width : 50,
										renderer : Grid.Format.multipleItemsRenderer(enumgenderObj)
									},
									{
										title : '是否残疾',
										dataIndex : 'isDisable',
										elCls : 'center',
										width : 50,
										renderer : Grid.Format.multipleItemsRenderer(enumgenderObj)
										
									},
									{
										title : '备注',
										dataIndex : 'memo',
										elCls : 'center',
										visible:false,
										width : 100
									},
									{
										title : '操作',
										elCls : 'center',
										width : 50,
										renderer : function(v, obj) {
											return '<span class="grid-command btn-edit">编辑</span>&nbsp;'
										}
									} ];
							// 实例化 Grid.Plugins.Cascade 插件
							var cascade = new Grid.Plugins.Cascade(
									{
										renderer : function(record) {
											var det = "";
											if(record.isDisable==1){//残疾人
												return '<div style="padding: 10px 20px;"><h2>残疾人主要信息</h2><table class="table table-bordered" style="width:60%"><tr><td>第二代残疾证编号：'
														+ record.disableCard+"</td><td>多重说明："
														+ record.disaHow+"</td><td>残疾类别："
														+ record.disaType+"</td><td>残疾等级："
														+ record.disaLevel+"</td><td>婚姻状况："
														+ record.marryStatus+"</td><td>有无劳动能力："
														+ record.hasWorkable
														+ '</td></tr><tr><td colspan="6">备注：'+record.memo+'</td></tr><table><div class="inner-grid"></div></div>';
											}
											return '<div style="padding: 10px 20px;"><h2>详情信息</h2><p>'
														+ record.item 
														+ '</p><p>'+record.memo+'</p><div class="inner-grid"></div></div>';
										}
									});

							var isAddRemote = false, editing = new Grid.Plugins.DialogEditing(
									{
										contentId : 'content', //设置隐藏的Dialog内容
										triggerCls : 'btn-edit', //触发显示Dialog的样式 
										//elStyle : {width:'100px', height:'200px'},
										align : {
											node : '#maincon', // 参考元素, falsy 或 window 为可视区域, 'trigger' 为触发元素, 其他为指定元素
											// points: ['cc','cc'], // ['tr', 'tl'] 表示 overlay 的 tl 与参考节点的 tr 对齐
											offset : [ 10, 12 ]
										// 有效值为 [n, m]
										},
										editor : {
											title : '残疾人家庭成员基本情况',
											width : 700,
											showMenu : true,
											listeners : {
												show : function() {
													//console.log($('#content').css({'position':'absolute','top':'10px'}));
												}
											},
											success : function() {
												var edtor = this, form = edtor.get('form'), 
												editType = editing.get('editType'), 
												url = 'data/addupdatemember';
												//检验
												form.valid();
												console.log(7777777);
												console.log(form);
												console.log(form.beforeSubmit);
												if (form.isValid()) {
													form.ajaxSubmit({ //表单异步提交
																url : url,
																method : 'post',
																success : function(
																		data) {
																	if (editType == 'add') {
																		if (data.result == 1) {
																			BUI.Message.Alert(data.msg,function(){
																				if(top.topManager){
																					top.topManager.reloadPage();
																				}
																			},'success');
																		} else {
																			BUI.Message.Alert(data.msg,function() {
																								edtor.cancel();
																								top.location.href = "/index.jsp";
																							},'warning');

																		}
																	} else {
																		BUI.Message.Alert(data.msg,function(){
																			if(top.topManager){
																				top.topManager.reloadPage();
																			}
																		},'success');
																	}
																	//将a 改成 1 测试一下显示错误
																	if (data.hasError) { //返回的数据是 {hasError : fasle,error : 'xxxx',field : 'xxx'},也可以是任意格式的数据如 ： {success : false,'error' : 'xxxxx'}
																		var field = data.field;
																		form.getField(field).showErrors([ data.error ]); //也可以多个字段的错误信息 例如 errors : [{field : 'a',error: 'addd'},{field : 'a',error: 'addd'}]
																	} else {
																		edtor.accept();
																	}

																},
																error : function() {
																	//do something
																	alert("出错！");
																},
																callback : function() {
																	alert("call back");
																}
															});
												}
											}
										}
									}), store = new Store({
								//data : data,
								url : 'data/memberinfo',
								autoLoad : true, //自动加载数据
								params : { //配置初始请求的参数
									baseInfoId : '${baseInfo.id}'
								},
								pageSize : 15,
								autoLoad : true
							}), grid = new Grid.Grid(
									{
										render : '#grid',
										columns : columns,
										multipleSelect : false,
										forceFit : true,
										maxHeight:300,
										emptyDataTpl : '<div class="centered"><h3 class="auxiliary-text"><br>该档案下暂无家庭成员信息，请点击左上角<span style="color:#333333">【完善家庭基本情况】</span>按钮进行完善！</h3></div>',
										tbar : {
								            items : [
								              {text : '<i class="icon-plus"></i>完善家庭基本情况',btnCls : 'button button-small btn-add',handler:addFunction},
								              {text : '<i class="icon-remove"></i>删除',btnCls : 'button button-small',handler : delFunction}
								            ]
								          },
										plugins : [ editing,
												Grid.Plugins.CheckSelection,
												Grid.Plugins.AutoFit,cascade],
										store : store,
									});

							grid.render();
							//添加最后一条记录，用于输入记录
							//store.add({operation : true});
							var cascade = new Grid.Plugins.Cascade({
								  		    renderer : function(record){
								  		    	var outpoorflag = "	<span class='x-icon x-icon-small x-icon-error'><i class='icon icon-white icon-ban-circle'></i></span>未脱贫<br>";
								  		    	if(record.isOutPoor==1){
								  		    		outpoorflag = "<span class='x-icon x-icon-small x-icon-success'><i class='icon icon-ok icon-white'></i></span>已脱贫,脱贫时间：";
								  		    		outpoorflag += record.outPoorDate +"，脱贫方式："+ record.outPoorWay+"<br>";
								  		    	}
								  			    return '<div style="padding: 10px 20px;"><h2>详情信息</h2><p>' +outpoorflag+ '</p></div>';
								  		    }
								        });
							//添加记录
							function addFunction() {
								var newData = {
									isOutPoor : '1',
									username : '张世发',
									memberId : '0',
									gender : '男',
									education : '小学',
									identityCard : '362135196102112563',
									workstatus : '外出打工',
									isHuzhu : '0',
									isInDibao : '0',
									isInYibao : '0',
									isInYanglao : '0',
									isDisable : '0',
									disaHow : '轻度',
									disaType : '视力残疾',
									disaLevel : '二级低视力',
									marryStatus : '未婚',
									hasWorkable : '有',
									baseInfoId : '${baseInfo.id}',
									disableCard : '362135196102112563021' 
								};
								editing.add(newData, 'a'); //添加记录后，直接编辑
							}
							//删除选中的记录
							function delFunction() {
								var selections = grid.getSelection();
								var bids="";
								$.each(selections,function(k,v){
									if(this.memberId)
										bids +=(this.memberId+",");
								});
								console.log(bids);
								if(confirm("确定删除？")){
									$.ajax({
					                    url : 'data/deletemember/'+bids,
					                    type : 'post',
					                    cache : false,
					                    dataType : 'json',
					                    data : 1,
					                    success : function( data ){
					                        if ( data.result==1) {
					                            // 删除成功
					                            BUI.Message.Alert( data.msg,function(){
					                            	store.remove(selections);
					                            	if(top.topManager){
						 	                            top.topManager.reloadPage();
					                            	}
					                            },'success' );
					                           
					                        } else {
					                            // 删除失败提示 - 改变提示样式
					                        	BUI.Message.Alert( data.msg, 'warning' );
					                        }
					                    } 
					                });
								}
							}
							//清除点击链接的默认事件
							grid.get('el').delegate('.grid-command', 'click',
									function(ev) {
										ev.preventDefault();
									});
							grid.on('cellclick', function(ev) {
								var target = ev.domTarget;
								/* 				$(ev.row).find("input[name='id']").each(function(){
								 //获取ID值
								 //alert($(this).val());
								 }); */
								if ($(target).hasClass("btn-view")) {
									//console.log(ev.record);
									//alert($(ev.row).find("input[name='id']").val()+55); 
									//alert(grid.getSelected());
									//取消当前行的选中状态
									grid.clearSelection();

									//return false;
									showData(ev.record);
								}
							});
							cascade.on('expand',function(ev) {
												console.log(ev);
											 
											});
							function showData(obj) {
								console.log(888888888);
								console.log(obj);
							}

						});
	</script>
	<!-- script end -->
</body>
</html>
